package com.example.management.config;

import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

@Configuration
public class MyMvcConfig implements WebMvcConfigurer {

    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(new LoginHandlerInterceptor())
                .addPathPatterns("/building/**", "/dormitory/**", "/manager/**", "/student/**").excludePathPatterns("/manager/login", "/manager/loginT");
//        addPath设置拦截哪些请求，excludePath设置不拦截哪些请求(即不用经过拦截器).
        /*        WebMvcConfigurer.super.addInterceptors(registry);*/
    }
}
